<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			var sumdan = 0;
			var sumshuang = 0;
			for (var i = 1; i <= 100; i++) {
				if (i % 2 == 0) {
					sumshuang = sumshuang + i;
				} else {
					sumdan = sumdan + i;
				}
			}
			console.log('奇数和为' + sumdan);
			console.log('偶数和为' + sumshuang);
		</script>
	</head>
	<body>
	</body>
</html>
